export default {
	namespaced:true,
	
	state:()=>({
		token:uni.getStorageSync('token') || '',
		address:'广西南宁市会展中心12号',
		userinfo:JSON.parse(uni.getStorageSync('userinfo')|| '{}')
	}),
	
	mutations:{
		updateUserInfo(state,userinfo){
			state.userinfo =userinfo
			this.commit('m_user/saveUserInfoToStorage')
		},
		saveUserInfoToStorage(state){
			uni.setStorageSync('userinfo',JSON.stringify(state.userinfo))
		},
		
		updateToken(state,token){
			state.token = token
			this.commit('m_user/saveTokenToStorage')
		},
		saveTokenToStorage(state){
			uni.setStorageSync('token',state.token)
		}
	},
	getters:{
		
	}
}